﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using StockManagement.ViewModels;
using StockManagement.Helper;
using StockManagement.Model;
using System.ComponentModel;

namespace StockManagement.Views
{
    /// <summary>
    /// Interaction logic for OutwardMaterial.xaml
    /// </summary>
    public partial class OutwardMaterial 
    {
     
        public OutwardMaterial()
        {
            InitializeComponent();
            this.DataContextChanged += new DependencyPropertyChangedEventHandler(MaterialStock_DataContextChanged);
            
        }

        void MaterialStock_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue == null)
                return;
            var matStockVM = e.NewValue as OutwardMaterialViewModel;
            if (matStockVM == null)
                return;

            mainGrid.DataContext = matStockVM;
        }

        private void cmbMaterialCode_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }
    }
}
